import React from 'react';
/* react-redux有一些方法将redux中的数据渲染到页面
react-redux是用来实现组件和redux之间的通信
 */
import {useSelector,useDispatch} from 'react-redux'
const Index = () => {
    const count = useSelector(state=>state.count)
    const dispatch = useDispatch();
    return (
        <div>
            <button
            onClick={()=>{
                dispatch({type:"increase"})
            }}>{count}</button>
        </div>
    );
}

export default Index;